{svc?.name ?? 'Detalhes'} — YAUM {#if loading}
{:else if !svc}

Serviço não encontrado

{:else}
← Voltar

{svc.name}

{svc.url}

{#if stats}

Uptime

{#each [ { label: '24h', uptime: stats.uptime_24h, checks: stats.total_checks_24h, avg: stats.avg_response_ms_24h }, { label: '7 dias', uptime: stats.uptime_7d, checks: stats.total_checks_7d, avg: stats.avg_response_ms_7d }, { label: '30 dias', uptime: stats.uptime_30d, checks: stats.total_checks_30d, avg: stats.avg_response_ms_30d } ] as item}
{item.label} {item.checks} checks
{item.uptime.toFixed(2)}% {item.avg.toFixed(0)}ms méd.
{/each}
{/if}

Tempo de Resposta (ms)

{#if chartHistory.length === 0}
Sem dados ainda
{:else if chartHistory.length === 1}
{chartHistory[0].response_time_ms} ms {chartHistory[0].is_up ? 'Online' : 'Offline'} — {chartHistory[0].status_code || 'timeout'}
{:else} {#each yAxis.ticks as tick} {tick.val} {/each} {#each segments as seg} {/each} {#each dots as d} {/each}
{new Date(chartHistory[0].tested_at).toLocaleTimeString('pt-BR', { hour: '2-digit', minute: '2-digit' })} {new Date(chartHistory[chartHistory.length - 1].tested_at).toLocaleTimeString('pt-BR', { hour: '2-digit', minute: '2-digit' })}
{/if}

Histórico de Verificações

{#each tableData as h}
{#if h.status_code > 0} {h.status_code} {:else} TIMEOUT {/if}
{h.response_time_ms}ms {#if h.error_message} {/if}
{#if expandedError === h.id && h.error_message}
{h.error_message}
{/if}
{/each}
{#if totalPages > 1}
{#each pages as p} {#if p === '...'} {:else} {/if} {/each}

Página {currentPage} de {totalPages} — {totalItems} verificações no total

{/if}
{/if}